package com.mlog.njyjy.ndop.monitor.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.mlog.njyjy.ndop.monitor.pojo.ResponseMessage;
import com.mlog.njyjy.ndop.monitor.service.ProductMonitorService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping(value = "/product")
@Api(value = "product", description = "产品监控接口")
public class ProductController {

	@Autowired
	private ProductMonitorService service;

	@GetMapping(value = "/product")
	@ApiOperation(value = "获取产品监控列表", httpMethod = "GET")
	public ResponseMessage listProduct(String startTime, String endTime, String keyWord, String alarmState, int pageNo,
			int pageCount) {
		return ResponseMessage.success(service.listProduct(startTime, endTime, keyWord, alarmState, pageNo, pageCount));
	}
	
	@GetMapping(value = "/process/category")
	@ApiOperation(value = "获取流程监控分类", httpMethod = "GET")
	public ResponseMessage listProcessCategory() {
		return ResponseMessage.success(service.listProcessCategory());
	}
	
	@GetMapping(value = "/process")
	@ApiOperation(value = "获取流程监控视图", httpMethod = "GET")
	public ResponseMessage listProcessView(long id, String date, String name, String pid, Boolean alarm) {
		return ResponseMessage.success(service.listProcessView(id, date, name, pid, alarm));
	}
	
	@GetMapping(value = "/options")
	@ApiOperation(value = "获取下拉选项", httpMethod = "GET")
	public ResponseMessage options() {
		return ResponseMessage.success(service.getOptions());
	}

}
